from qcloudsms_py import SmsSingleSender
from qcloudsms_py.httpclient import HTTPError

# 短信配置
sms_app_id = 1400912423

sms_app_key = "eb92c0a441a9a51e7c69c96eda34a29e"
# 短信模板ID
dead_line_template = 404245

normal_template = 2162747

verification_template = 1029593

# 签名
sms_sign = "佳序网络"
sms_type = 0  # Enum{0: 普通短信, 1: 营销短信}
params = []  # 当模板没有参数时，`params = []`

sms_sender = SmsSingleSender(sms_app_id, sms_app_key)


def send_normal_sms(phone, customer_phone, name, address):
    result = sms_sender.send_with_param(86, phone, normal_template, [name, customer_phone, address],
                                        sign=sms_sign, extend="", ext="")
    return result


if __name__ == '__main__':
    # manager.run()
    res = send_normal_sms("18077955824", "18888888788", "张三丰", "一品湾")
    print(res)
